+2005-09-11 Øyvind Kolås <pippin@gimp.org>
+
+ * babl/babl-classes.h: Removed unused list of conversions to
+ types/models/formats.
+
+ * babl/babl-conversion.c: (conversion_new):
+ * babl/babl-format.c: (each_babl_format_destroy), (format_new):
+ * babl/babl-image.c: (babl_image_from_linear):
+ * babl/babl-introspect.c: (item_conversions_introspect):
+ * babl/babl-memory.c: (babl_realloc):
+ * babl/babl-model.c: (each_babl_model_destroy), (model_new):
+ * babl/babl-sampling.c: (each_babl_sampling_destroy):
+ * babl/babl-sanity.c: (type_sanity), (model_sanity), (babl_sanity):
+ * babl/babl-type.c: (each_babl_type_destroy), (type_new):
+
2005-09-09 Øyvind Kolås <pippin@gimp.org>
* docs/Makefile.am: set BABL_PATH to builddir for creating the
{
BablInstance instance;
BablConversion **from; /*< NULL terminated list of conversions from class */
- BablConversion **to; /*< NULL terminated list of conversions to class */
int bits; /*< number of bits used to represent the data type
(initially restricted to a multiple of 8) */
double min_val;
{
BablInstance instance;
BablConversion **from; /*< NULL terminated list of conversions from class */
- BablConversion **to; /*< NULL terminated list of conversions to class */
int horizontal;
int vertical;
char name[4];
{
BablInstance instance;
BablConversion **from; /*< NULL terminated list of conversions from class */
- BablConversion **to; /*< NULL terminated list of conversions to class */
int components;
BablComponent **component;
BablType **type; /*< must be doubles, used here for convenience in code */
{
BablInstance instance;
BablConversion **from; /*< NULL terminated list of conversions from class */
- BablConversion **to; /*< NULL terminated list of conversions to class */
int components;
BablComponent **component;
BablType **type;
babl->conversion.processings = 0;
babl_add_ptr_to_list ((void ***)&(source->type.from), babl);
- babl_add_ptr_to_list ((void ***)&(destination->type.to), babl);
return babl;
}
void *data)
{
babl_free (babl->format.from);
- babl_free (babl->format.to);
babl_free (babl);
return 0; /* continue iterating */
sizeof (int) * (components));
babl->format.from = NULL;
- babl->format.to = NULL;
babl->format.component = ((void *)babl) + sizeof (BablFormat);
babl->format.type = ((void *)babl->format.component) + sizeof (BablComponent*) * (components);
babl->format.sampling = ((void *)babl->format.type) + sizeof (BablType*) * (components);
Babl *
babl_image_from_linear (void *buffer,
- Babl *format)
+ Babl *format)
{
Babl *babl;
- BablModel *model;
- int components;
+ BablModel *model = NULL;
+ int components = 0;
int i;
BablComponent *component [BABL_MAX_COMPONENTS];
BablSampling *sampling [BABL_MAX_COMPONENTS];
ptr++;
}
- if (babl->type.to)
- babl_log ("\t\tconversions to %s: %i",
- babl->instance.name, list_length ((void **)(babl->type.to)));
-
-
- ptr = (void **)babl->type.to;
-
- while (ptr && NULL!=*ptr)
- {
- babl_log ("\t\t\t'%s'", ((Babl *)(*ptr))->instance.name);
- ptr++;
- }
}
static void
babl_realloc (void *ptr,
size_t size)
{
- void *ret;
+ void *ret = NULL;
if (!ptr)
{
void *data)
{
babl_free (babl->model.from);
- babl_free (babl->model.to);
babl_free (babl);
return 0; /* continue iterating */
}
memcpy (babl->model.component, component, sizeof (BablComponent*)*components);
babl->model.from = NULL;
- babl->model.to = NULL;
return babl;
}
void *data)
{
babl_free (babl->sampling.from);
- babl_free (babl->sampling.to);
return 0; /* continue iterating */
}
return 0;
}
-static Babl *babl_conversion_source (Babl *babl);
static Babl *babl_conversion_destination (Babl *babl);
static int
babl->instance.name);
}
-
- ok = 0;
- if (babl->type.to)
- {
- ptr = (void **) babl->type.to;
-
- while (ptr && NULL!=*ptr)
- {
- if (babl_conversion_source ((Babl *)(*ptr)) == babl_type_id (BABL_DOUBLE))
- {
- ok = 1;
- break;
- }
- ptr++;
- }
- }
- if (!ok)
- {
- OK=0;
- babl_log ("lack of sanity! type '%s' has no conversion from double",
- babl->instance.name);
- }
-
return 0;
}
babl->instance.name);
}
-
- ok = 0;
- if (babl->model.to)
- {
- ptr = (void **) babl->model.to;
-
- while (ptr && NULL!=*ptr)
- {
- if (babl_conversion_source ((Babl *)(*ptr)) == babl_model_id (BABL_RGBA))
- {
- ok = 1;
- break;
- }
- ptr++;
- }
- }
- if (!ok)
- {
- babl_log ("lack of sanity! model '%s' has no conversion from 'rgba'",
- babl->instance.name);
- OK=0;
- }
-
return 0;
}
return OK;
}
-static Babl *babl_conversion_source (Babl *babl)
-{
- return (Babl *)babl->conversion.source;
-}
-
static Babl *babl_conversion_destination (Babl *babl)
{
return (Babl *)babl->conversion.destination;
void *data)
{
babl_free (babl->type.from);
- babl_free (babl->type.to);
babl_free (babl);
return 0; /* continue iterating */
}
strcpy (babl->instance.name, name);
babl->type.bits = bits;
babl->type.from = NULL;
- babl->type.to = NULL;
return babl;
}